using DapperExtensions.Mapper;

namespace Read.Models
{
    /// <summary>
    /// 字段映射
    /// </summary>
    public class OperationLogMapper : ClassMapper<OperationLogModel>
    {
        public OperationLogMapper()
        {
            Table(Tables.OperationLog);
            Map(c => c.Id).Column("Id").Key(KeyType.Identity);
            Map(c => c.Uid).Column("Uid");
            Map(c => c.Time).Column("Time");
            Map(c => c.Ip).Column("Ip");
            Map(c => c.Status).Column("Status");
            Map(c => c.Info).Column("Info");
            Map(c => c.Url).Column("Url");
        }
    }

    /// <summary>
    /// 操作日志类
    /// </summary>
    public class OperationLogModel
    {
        /// <summary>
        /// 日志Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 操作帐号Id
        /// </summary>
        public int Uid { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public int Time { get; set; }

        /// <summary>
        /// 操作Ip
        /// </summary>
        public string Ip { get; set; }

        /// <summary>
        /// 状态,0错误提示，1为正确提示
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 其他说明
        /// </summary>
        public string Info { get; set; }

        /// <summary>
        /// 操作请求的URL
        /// </summary>
        public string Url { get; set; }
    }
}